<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加代理商 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head.html"/>
<link href="${base}/thirdparty/swfupload2_5/swf.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">var _BASE="${base}/";</script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/swfupload.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/fileprogress.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/handlers_logo.js" charset="utf-8"></script>
<link href="${base}/thirdparty/ztree/css/core.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/thirdparty/ztree/js/core.js"></script>

<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $browserAgency = $("input.browserAgency");
	var $browserAccount = $('input.browserAccount');
	
	$browserAccount.browser({
		type: "html",
		title:"选择账号", 
		isUpload:true,
		browserUrl:  "../agent/v_account_tree.jspx"
	});
	
	$browserAgency.browser({
			type: "html",
			title:"选择推荐商", 
			isUpload:true,
			browserUrl:  "../agent/v_agency_tree.jspx"
	});
	
	// 表单验证
	$inputForm.validate({
		rules: {
			mobile: { required: false,digits:true, minlength:11, remote:{
				url:"../v_check_mobile.jspx",
				cache:false
			} },
			email: {required: false,email:true, maxlength:100,remote:{
				url:"../v_check_email.jspx",
				cache:false
			}},
			contract:{required: true},
			address:{required: false},
			tel:{required: true},
			qqService:{required: true,digits:true, minlength:5},
			
			username: {
				required: true,
				pattern: /^[0-9a-z_A-Z\u4e00-\u9fa5]+$/,
				minlength: 2,
				maxlength: 30,
				remote: {
					url: "../v_check_username.jspx",
					cache: false
				}
			},
			password: {
				required: true,
				pattern: /^[^\s&\"<>]+$/,
				minlength: 4,
				maxlength: 20
			},
			rePassword: {
				required: true,
				equalTo: "#password"
			},
			intermediaName: {
				required:true,
				remote: {
					url: "../v_check_name.jspx",
					cache: false
				}
			},
			accountFunds: {
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			
		},
		messages: {
			username: {
				remote: "已存在"
			},
			intermediaName:{
				remote:"已存在"
			},
			mobile:{
				remote:"已存在"
			},
			email:{
				remote:"已存在"
			}
		}
		
	});
	
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 添加代理商
	</div>
	<form id="inputForm" action="o_save.jspx" method="post"  >
		<input type="hidden" id="disabled"  name="disabled" value="false"  />
		<table class="input tabContent">
			<tr>
				<th><h3>基本资料：</h3></th>
				<td colspan="3">&nbsp;</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>代理商名称:</th>
				<td>
					<input type="text" name="intermediaName" class="text" maxlength="100" title="公司请填写公司名称，个人可以填写个人名称" />
				</td>
				<th><span class="requiredField">*</span>登录名:</th>
				<td>
					<input type="text" name="username" class="text" maxlength="30" title="请指定一个登录名称" />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>密码:</th>
				<td>
					<input type="password" name="password"  id="password" class="text" maxlength="100"  />
				</td>
				<th><span class="requiredField">*</span>确认密码:</th>
				<td>
					<input type="password" name="rePassword"  class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>联系电话:</th>
				<td>
						<input type="text" name="tel" class="text" maxlength="100"  />
				</td>
				<th><span class="requiredField">*</span>联系QQ:</th>
				<td>
						<input type="text" name="qqService" class="text" maxlength="15"  />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>联系人:</th>
				<td>
						<input type="text" name="contract" class="text" maxlength="30"  />
				</td>
				<th>联系地址:</th>
				<td>
						<input type="text" name="address" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>Email:</th>
				<td>
					<input type="text" name="email" class="text" maxlength="100"  title="邮箱可以用来发送信息"/>
				</td>
				<th>手机号码:</th>
				<td>
					<input type="text" name="mobile" class="text" maxlength="11"  />
				</td>
			</tr>
			<tr>
				<th>上推荐商:</th>
				<td>
						<input type="text" name="recommentAgent"  id="recommentAgent" class="text" maxlength="100"  readonly="readonly" value="<#if admin.intermediaName??>${admin.intermediaName!}<#else>${admin.username!}</#if>"/>
						<input type="button" class="button browserAgency" value="选择"/>
				</td>
				<th>推荐账号:</th>
				<td>
						<input type="text" name="recommentAccount"  id="recommentAccount" class="text" maxlength="100"  readonly="readonly" value="${admin.username!}" />
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr><th><h3>高级资料：</h3></th><td colspan="3">&nbsp;</td></tr>
			<tr>
				<th>企业名称:</th>
				<td>
						<input type="text" name="enterpriseName" class="text" maxlength="100"  />
				</td>
				<th>证件名称:</th>
				<td>
						<input type="text" name="documentName" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>证件号码:</th>
				<td>
						<input type="text" name="documentNum" class="text" maxlength="100"  />
				</td>
				<th>证件类型:</th>
				<td>
						<input type="text" name="documentType" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>营业执照:</th>
				<td>
						<input type="text" name="businessLicense" class="text" maxlength="100"  />
				</td>
				<th>税务登记号:</th>
				<td>
						<input type="text" name="taxRegistrationNumber" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>组织机构代码证:</th>
				<td>
						<input type="text" name="organizationCodeCertificate" class="text" maxlength="100"  />
				</td>
				<th>结算银行:</th>
				<td>
						<input type="text" name="bis" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>法定代表人:</th>
				<td>
						<input type="text" name="legalRepresentative" class="text" maxlength="100"  />
				</td>
				<th>开户名称:</th>
				<td>
						<input type="text" name="accountName" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>交易商编码开始:</th>
				<td>
						<input type="text" name="tradersCodingBegins" class="text" maxlength="100"  />
				</td>
				<th>交易商编码结束:</th>
				<td>
						<input type="text" name="tradersCodingEnds" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>银行帐号:</th>
				<td>
						<input type="text" name="bankAccount" class="text" maxlength="100"  />
				</td>
				<th>账户资金:</th>
				<td>
						<input type="text" name="accountFunds" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>备注说明:</th>
				<td colspan="3">
					<textarea name="intro" style="width:400px;height:100px"></textarea>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>证件扫描：</th>
				<td>
					<div id='fsUploadProgress'class='clearfix'></div>
					<input type="button" id="uploadBtn" value="选择文件"  class="button"/>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定"  <#if admin.system>disabled</#if> />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.jspx'" />
				</td>
			</tr>
		</table>
	</form>
	<#include "../footer.html"/>
</body>
</html>
<script type='text/javascript'>
var swfu;
var jsessionid = getCookie("JSESSIONID");
var uploadUrl='/all_upload.jhtml';
if(jsessionid) {
	uploadUrl += ";jsessionid="+jsessionid;
}
var settings = {
	post_params: {"directory": "upload"},
	flash_url:"${base}/thirdparty/swfupload2_5/swfupload.swf", 
	flash9_url:"${base}/thirdparty/swfupload2_5/swfupload_fp9.swf", 
	upload_url: uploadUrl,  
	file_size_limit:"1MB", 
	file_types:"*.jpg;*.png;*.gif;*.jpeg", 
	file_types_description:"JPG Images; PNG Image", 
	file_upload_limit:10, 
	file_queue_limit:0, 
	custom_settings:{progressTarget:"fsUploadProgress", cancelButtonId:"btnCancel"}, 
	button_image_url:"${base}/thirdparty/swfupload2_5/choose_file.jpg", 
	button_placeholder_id:"uploadBtn", 
	button_width:175, 
	button_height:52, 
	button_text_top_padding:0, 
	button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT, 
	button_cursor:SWFUpload.CURSOR.HAND, 
	swfupload_preload_handler:preLoad, 
	swfupload_load_failed_handler:loadFailed, 
	file_queued_handler:fileQueued, 
	file_queue_error_handler:fileQueueError, 
	upload_start_handler:uploadStart, 
	upload_progress_handler:uploadProgress, 
	upload_error_handler:uploadError, 
	upload_success_handler:uploadSuccess, 
	upload_complete_handler:uploadComplete
};

swfu = new SWFUpload(settings);
$(document).ready(function(){
	if( !swfu.support.loading ){
		$('#fsUploadProgress').html('您当前的Flash Player版本过低,无法支持头像上传,点击<a href="http://get.adobe.com/cn/flashplayer/otherversions/" target="_blank">下载</a>');
	}
})
</script>